using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace CreamX.Framework.Game.GUI
{
    public class GUIButton:CreamXAnimatedObject
    {
        public string Text;
        public GUIButton()
        {
        }
        public void PerformClick()
        {
            if(Clicked!=null)Clicked(this);
        }
        public void PerformHover()
        {
            if (Hover != null) Hover(this);
        }
        public bool MouseDown;
        public event ClickedHandler Clicked;
        public event MouseHandler Hover;
        public delegate void ClickedHandler(GUIButton sender);
        public delegate void MouseHandler(GUIButton sender);
        public bool IsMouseOver()
        {
            //Rectangle __r1 = new Rectangle((int)CreamXGame.Instance.UniversalMouse.Position.X, (int)CreamXGame.Instance.UniversalMouse.Position.Y, 1, 1);
            //    Rectangle __r2 = new Rectangle((int)Position.X, (int)Position.Y,
            //        (int)DisplayWidth, (int)DisplayHeight);
            //    //if (button.Value.GetBoundingSphere().Intersects(new BoundingBox(new Vector3(position, 0), new Vector3(position.X+1,position.Y+1, 0))))
            //    if (__r1.Intersects(__r2))
            //    {
            //        return true;
            //    }
            //    else
            //        return false;
            return false;
        }       

    }
}
